package com.yq.mapper;

import com.yq.model.bo.AddTypeBO;
import com.yq.model.bo.DeleteSpecBO;
import com.yq.model.bo.ReplyBO;
import com.yq.model.po.*;
import com.yq.model.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface AdminMapper {
    int queryCountByUsernameAndPassword(@Param("admin") Admin admin);

    List<AdminInfoVO> queryAllAdminInfo();

    int addAdmin(@Param("admin") Admin admin);

    AdminInfoVO queryById(@Param("id") int id);

    int updateAdminInfo(@Param("admin") Admin admin);

    int deleteAdminById(@Param("id") int id);

    List<AdminInfoVO> getSearchAdminsByUsernameOrNickname(@Param("admin") Admin admin);


    //user
    List<UserInfoVO> getAllUsersInfo();

    int deleteById(@Param("userId") int userId);

    List<UserInfoVO> searchUser(@Param("word") String word);


    // goods

    List<AdminGoodsTypeVO> getGoodsType();

    void AddGoods(@Param("goods") Goods goods);

    void addSpecs(@Param("specsList") ArrayList<Spec> specsList);

    List<GoodsVO> searchGoodsByTypeIdInfo(@Param("typeIds") int typeIds);

    void deleteGoodsById(@Param("goodsId") Integer goodsId);

    void deleteSpecById(@Param("goodsId") Integer goodsId);

    List<GetGoodsByIdVO> getGoodsInfoById(@Param("goodsId") int goodsId);


    int addGoodsType(@Param("addTypeBO") AddTypeBO addTypeBO);

    int deleteGoodsTypeById(@Param("tId") int tId);

    void updateGoods(@Param("goods") Goods goods);

    void updateGoodsType(@Param("spec") Spec spec);


    void deleteSpec(@Param("goodsid") Integer goodsid);

    List<NoReplyMsgVO> getNoReplyMsg(@Param("state") int state);

    int replay(@Param("replyBO") ReplyBO replyBO);
}
